class egretUtils{
    public static cleanText(container: egret.DisplayObjectContainer) {
        const children = container.$children;
        const length = children.length;
        for (let i = 0; i < length; ++i) {
            const child = children[i];
            if (child.$children && child.$children.length) {
                this.cleanText(<egret.DisplayObjectContainer>child);
            }
            else if (child.$renderNode) {
                let textNode: egret.sys.TextNode;
                if (child.$renderNode instanceof egret.sys.TextNode) {
                    textNode = child.$renderNode;
                }
                else if (child.$renderNode instanceof egret.sys.GroupNode && child.$renderNode.drawData[0] instanceof egret.sys.TextNode) {
                    textNode = child.$renderNode.drawData[0];
                }
                if (textNode) {
                    textNode.clean();
                }
            }
        }
    }
}